package com.web;

import com.pojo.dto.Message;

import com.pojo.vo.TopPickVo;

import com.service.TopPickService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class TopPickController {
    @Autowired
    TopPickService topPickService;

    @PostMapping("/toplist")//头筹查询所有
    public Message<List<TopPickVo>> findList(TopPickVo topPickVo) {
        return topPickService.list(topPickVo);
    }

    @PostMapping("/topone")//头筹查询一个
    public Message<TopPickVo> get(TopPickVo topPickVo) {
        return topPickService.get(topPickVo);
    }

    @PostMapping("/top/add")//头筹添加
    public Message<TopPickVo> add(TopPickVo topPickVo) {
        return topPickService.add(topPickVo);
    }

    @PostMapping("/top/delete")//头筹删除
    public Message<TopPickVo> delete(TopPickVo topPickVo) {
        return topPickService.delete(topPickVo);
    }

    @PostMapping("/top/edit")//修改接口
    public Message<TopPickVo> edit(TopPickVo topPickVo) {
        return topPickService.edit(topPickVo);
    }

    @PostMapping("/top/state") //开筹接口
    public Message<TopPickVo> state(TopPickVo topPickVo) {
        return topPickService.state(topPickVo);
    }

}
